<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 22] The java.awt.peer Package</TITLE>
<META NAME="author" CONTENT="David Flanagan">
<META NAME="date" CONTENT="Thu Jul 31 16:16:54 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java">
<META NAME="title" CONTENT="Java in a Nutshell">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">
<script language='JavaScript'>
<!--
if (location.replace) {
 location.replace ('ch22_js.htm');
}
// -->
</script>

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java in a Nutshell" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch21_14.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 22</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch22_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<H1 CLASS=chapter><A CLASS="TITLE" NAME="JNUT2-CH-22">22. The java.awt.peer Package</A></H1>

<DIV CLASS=htmltoc>

<p>
<b>Contents:</b><br>
<a href='ch22_02.htm'>java.awt.peer.CanvasPeer (JDK 1.0)</a><br>
<a href='ch22_03.htm'>java.awt.peer.CheckboxMenuItemPeer (JDK 1.0)</a><br>
<a href='ch22_04.htm'>java.awt.peer.CheckboxPeer (JDK 1.0)</a><br>
<a href='ch22_05.htm'>java.awt.peer.ChoicePeer (JDK 1.0)</a><br>
<a href='ch22_06.htm'>java.awt.peer.ComponentPeer (JDK 1.0)</a><br>
<a href='ch22_07.htm'>java.awt.peer.ContainerPeer (JDK 1.0)</a><br>
<a href='ch22_08.htm'>java.awt.peer.DialogPeer (JDK 1.0)</a><br>
<a href='ch22_09.htm'>java.awt.peer.FileDialogPeer (JDK 1.0)</a><br>
<a href='ch22_10.htm'>java.awt.peer.FontPeer (JDK 1.1)</a><br>
<a href='ch22_11.htm'>java.awt.peer.FramePeer (JDK 1.0)</a><br>
<a href='ch22_12.htm'>java.awt.peer.LabelPeer (JDK 1.0)</a><br>
<a href='ch22_13.htm'>java.awt.peer.LightweightPeer (JDK 1.1)</a><br>
<a href='ch22_14.htm'>java.awt.peer.ListPeer (JDK 1.0)</a><br>
<a href='ch22_15.htm'>java.awt.peer.MenuBarPeer (JDK 1.0)</a><br>
<a href='ch22_16.htm'>java.awt.peer.MenuComponentPeer (JDK 1.0)</a><br>
<a href='ch22_17.htm'>java.awt.peer.MenuItemPeer (JDK 1.0)</a><br>
<a href='ch22_18.htm'>java.awt.peer.MenuPeer (JDK 1.0)</a><br>
<a href='ch22_19.htm'>java.awt.peer.PanelPeer (JDK 1.0)</a><br>
<a href='ch22_20.htm'>java.awt.peer.PopupMenuPeer (JDK 1.1)</a><br>
<a href='ch22_21.htm'>java.awt.peer.ScrollPanePeer (JDK 1.1)</a><br>
<a href='ch22_22.htm'>java.awt.peer.ScrollbarPeer (JDK 1.0)</a><br>
<a href='ch22_23.htm'>java.awt.peer.TextAreaPeer (JDK 1.0)</a><br>
<a href='ch22_24.htm'>java.awt.peer.TextComponentPeer (JDK 1.0)</a><br>
<a href='ch22_25.htm'>java.awt.peer.TextFieldPeer (JDK 1.0)</a><br>
<a href='ch22_26.htm'>java.awt.peer.WindowPeer (JDK 1.0)</a><br>
<p>
<p>
</DIV>

<P CLASS=para>
The <tt CLASS=literal>java.awt.peer</tt> package consists entirely of
interface definitions. The hierarchy of these interfaces is
shown in
<A HREF="ch22_01.htm#JNUT2-CH-22-FIG-1">Figure 22.1</A>.<A NAME="CH22.JAVA.AWT.PEE1"></A><A NAME="CH22.PEERS-1"></A>
Each <tt CLASS=literal>java.awt.peer</tt> interface corresponds to one of
the <tt CLASS=literal>java.awt</tt> <tt CLASS=literal>Component</tt> or
<tt CLASS=literal>MenuComponent</tt> classes, and as you can see from the
figure, the hierarchy of this package is identical to the
hierarchy of those portions of the <tt CLASS=literal>java.awt</tt> package.

<P CLASS=para>
The interfaces in this package define the methods that must
be supported by the GUI components on a specific platform.
Porting the <tt CLASS=literal>java.awt</tt> GUI components to a new platform 
is a matter of implementing each of the methods in each of the
interfaces in this package on top of the native GUI
components of that platform. The <tt CLASS=literal>Toolkit</tt> object in
the <tt CLASS=literal>java.awt</tt> package collects the implementations of
these peer interfaces for a given platform. <tt CLASS=literal>Toolkit</tt>
contains methods that create instances of each of the
interfaces in this package. Normal applications never need
to instantiate these peers directly; instead they use the
<tt CLASS=literal>java.awt</tt> <tt CLASS=literal>Component</tt> classes, which create
peers as needed.

<P CLASS=para>
Because these peer interfaces are rarely used, and because
the methods are quite similar to those of the corresponding
<tt CLASS=literal>java.awt</tt> component, there is no additional
commentary for the individual interface definitions below.

<DIV CLASS=figure>
<h4 CLASS=figure><A CLASS="TITLE" NAME="JNUT2-CH-22-FIG-1">Figure 22.1: The java.awt.peer package</A></h4>


<p>
<img align=middle src="./figs/jn2_2201.gif" alt="[Graphic: Figure 22-1]" width=464 height=421 border=0>

</DIV>

<DIV CLASS=sect1>
<h2 CLASS=sect1><A CLASS="TITLE" NAME="JNUT2-CH-22-SECT-1">22.1 java.awt.peer.ButtonPeer (JDK 1.0)</A></h2>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JNUT2-CH-22-SECT-1.1"></A></h3>
</DIV>

<P CLASS=para>
<DIV CLASS=screen>
<P>
<PRE>
public abstract interface <tt CLASS=literal>ButtonPeer</tt> extends ComponentPeer {
    // <tt CLASS=literal>Public Instance Methods</tt>
            public abstract void <tt CLASS=literal>setLabel</tt>(String <tt CLASS=literal>label</tt>);
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JNUT2-CH-22-SECT-1.2">Returned By:</A></h3>

<P CLASS=para>
Toolkit.createButton()

</DIV>

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch21_14.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch22_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>java.awt.image.ReplicateScaleFilter (JDK 1.1)</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>java.awt.peer.CanvasPeer (JDK 1.0)</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
